import React, { Component } from 'react'

export default class TodoHeader extends Component {
  render() {
    return (
      <div>
        <input 
          type='text'
          value={this.props.val}
          onInput={this.fn}
        /><button onClick={this.push}>添加</button>
      </div>
    )
  }
  fn=(e)=>{
    this.props.fn(e.target.value)
  }
  push=()=>{
    this.props.push()
  }
}
